import json
import io
import time

from hhh import hhh as h

json_file = {
    "remote_videos": "[\"190a14ab7a354fea815c35da3014e9fe\"]",
    "resource_json": "[\"0ec01fdf41f64d529cf94e241da1144f\",\"73d8b5ed69194408826665fac47a2d20\",\"17743bd4fe4841e386b1697099f1f228\",\"4948130636a842d7a73a5b948f11b72a\",\"d277c2406d404788bac511f26fc250b3\",\"4b16113d564a4337b6ab1e2ba8767bf7\",\"0d9a6f53a5184d2d9207239f35f0b9d9\",\"1a62b8f4bfbc4598ac163ac04a21a992\",\"f0748a2e9da04959b8b50c80f2075b65\",\"ef82336c6afc4975be91e36dcf1941e0\",\"f1ed82e6fb6847e2b17f629c01c40fd4\",\"9c0e3ef65ee14339be24e8fca6829eb0\",\"057a485d77e94792bdc0701fc8cb3f68\",\"f67315730fc4455da987c210f1e16b8a\",\"78ca7189f5fd484d847e2edd994ae659\",\"4957e5fb1c484f1c8bf7b5282e27cecb\",\"794bb7ab65c142d8b224583785cb70db\",\"13a0de4fcb4b4ea19e6446ec5011a3fa\"]",
    "text_json": "{\"descName\":\"王可出品-小小老师1\",\"id\":\"simonzhaote}",
    "thumbnail": "",
    "web_class": "private",
    "web_id": "5af7c03dc65a443eb2e213d248daa776",
    "web_json": "{\"descName\":\"王可出品-小小老师1\",\"id\":\"simonzhaot}",
    "web_name": "王可出品-小小老师1",
    "web_ref_id": "simonzhaotest1"
}

editor_info = {
    "web_ref_id": "simonzhaotest002",
    "web_json": "[{\"descName\":\"simon zhao 测试课程\",\"id\":\"simonzhaotest002\",\"type\":\"game\","
                "\"package\":\"simonzhaotest002_P\",\"isPlatform\":true,\"logic\":{},\"views\":[],\"webAttrs\":{"
                "\"modelList\":[],"
                "\"thumbnail\":\"https://qiniucdn.jiliguala.com/resource/crmsandbox"
                "/1f0948395e8bc1ac35c6fdf4b2c568cd-MAL1W09D4Q1_pic_P2_3_heart.png\",\"crossScene\":{}}},"
                "{\"descName\":\"section-0\",\"id\":\"a335896adcf14976\",\"background\":\"\","
                "\"enterTransition\":\"default\",\"leaverTransition\":\"default\",\"views\":[{\"config\":{"
                "\"id\":{\"type\":\"string\",\"value\":\"itemId-a3358be32899e6dd\",\"inputType\":\"string\","
                "\"isShow\":true,\"writed\":false,\"disabled\":false,\"name\":\"唯一id\",\"selectOption\":[]},"
                "\"descName\":{\"type\":\"string\",\"value\":\"MAL3W02D3Q4.mp4\",\"inputType\":\"string\","
                "\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"文字描述\",\"selectOption\":[]},"
                "\"type\":{\"type\":\"string\",\"value\":\"video\",\"inputType\":\"string\",\"isShow\":true,"
                "\"writed\":false,\"disabled\":false,\"name\":\"类型\",\"selectOption\":[]},\"position\":{"
                "\"type\":\"object\",\"value\":{},\"inputType\":\"parent\",\"isShow\":true,\"writed\":true,"
                "\"disabled\":false,\"name\":\"位置坐标\",\"children\":{\"x\":{\"type\":\"number\",\"value\":-280,"
                "\"inputType\":\"number\",\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"X\","
                "\"selectOption\":[]},\"y\":{\"type\":\"number\",\"value\":105.71,\"inputType\":\"number\","
                "\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"Y\",\"selectOption\":[]}}},"
                "\"anchorX\":{\"type\":\"number\",\"value\":0.5,\"inputType\":\"number\",\"isShow\":true,"
                "\"writed\":true,\"disabled\":false,\"name\":\"锚点横坐标\",\"selectOption\":[]},\"anchorY\":{"
                "\"type\":\"number\",\"value\":0.5,\"inputType\":\"number\",\"isShow\":true,\"writed\":true,"
                "\"disabled\":false,\"name\":\"锚点纵坐标\",\"selectOption\":[]},\"active\":{\"type\":\"boolean\","
                "\"value\":true,\"inputType\":\"boolean\",\"isShow\":true,\"writed\":true,\"disabled\":false,"
                "\"name\":\"是否隐藏\",\"selectOption\":[]},\"opacity\":{\"type\":\"number\",\"value\":255,"
                "\"inputType\":\"number\",\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"透明度\","
                "\"selectOption\":[]},\"scale\":{\"type\":\"number\",\"value\":1,\"inputType\":\"number\","
                "\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"缩放\",\"selectOption\":[]},"
                "\"zIndex\":{\"type\":\"number\",\"value\":101,\"inputType\":\"number\",\"isShow\":true,"
                "\"writed\":true,\"disabled\":false,\"name\":\"z轴\",\"selectOption\":[]},\"isFullScreen\":{"
                "\"type\":\"boolean\",\"value\":false,\"inputType\":\"boolean\",\"isShow\":true,\"writed\":true,"
                "\"disabled\":false,\"name\":\"是否全屏\",\"selectOption\":[]},\"isRemoteVideo\":{"
                "\"type\":\"boolean\",\"value\":true,\"inputType\":\"boolean\",\"isShow\":true,\"writed\":true,"
                "\"disabled\":false,\"name\":\"是否远程视频\",\"selectOption\":[]},\"playerType\":{\"type\":\"enum\","
                "\"value\":\"IjkPlayer\",\"inputType\":\"enum\",\"isShow\":true,\"writed\":true,"
                "\"disabled\":false,\"name\":\"播放器类型\",\"selectOption\":[\"IjkPlayer\",\"VideoToys\","
                "\"VideoPlayer\"]},\"startTime\":{\"type\":\"number\",\"value\":0,\"inputType\":\"number\","
                "\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"开始时间\",\"selectOption\":[]},"
                "\"size\":{\"type\":\"object\",\"value\":{},\"inputType\":\"parent\",\"isShow\":true,"
                "\"writed\":true,\"disabled\":false,\"name\":\"尺寸\",\"children\":{\"width\":{\"type\":\"number\","
                "\"value\":1280,\"inputType\":\"number\",\"isShow\":true,\"writed\":true,\"disabled\":false,"
                "\"name\":\"宽\",\"selectOption\":[]},\"height\":{\"type\":\"number\",\"value\":720,"
                "\"inputType\":\"number\",\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"高\","
                "\"selectOption\":[]}}},\"resource\":{\"type\":{\"id\":\"\",\"name\":\"\"},\"value\":{"
                "\"resource_id\":\"b7fb836785284d568d477321ee2e233e\",\"resource_name\":\"MAL3W02D3Q4.mp4\","
                "\"resource_type\":\"video\",\"resource_version\":\"9\",\"files\":[{"
                "\"file_id\":\"679e60d92fc443bdb86a7de8b1726d80\",\"file_name\":\"MAL3W02D3Q4.mp4\","
                "\"file_path\":\"\",\"file_path_deploy\":\"video/MAL3W02D3Q4.mp4\","
                "\"file_md5\":\"e81bf6ce7498a1cb2593eae6c27fda89\","
                "\"file_cdn_url\":\"https://qiniucdn.jiliguala.com/resource/crmprod"
                "/e81bf6ce7498a1cb2593eae6c27fda89-MAL3W02D3Q4.mp4\","
                "\"file_dc_id\":\"/upload/crmprod/e81bf6ce7498a1cb2593eae6c27fda89-MAL3W02D3Q4.mp4\"}],"
                "\"upload_id\":\"13f8cb3b22524cc4a5ba955aa5d05493\",\"upload_name\":\"K3MAF00804_P.zip\","
                "\"source_type\":\"private\"},\"inputType\":\"resource\",\"isShow\":true,\"writed\":true,"
                "\"disabled\":false,\"name\":\"资源\",\"selectOption\":[]},\"children\":{\"type\":[],\"value\":[],"
                "\"inputType\":\"children\",\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"子节点\","
                "\"selectOption\":[]}},\"webAttrs\":{\"anchorMove\":{\"x\":0,\"y\":0,\"oldX\":0,\"oldY\":0},"
                "\"url\":\"https://qiniucdn.jiliguala.com/resource/crmprod/e81bf6ce7498a1cb2593eae6c27fda89"
                "-MAL3W02D3Q4.mp4\",\"upload_name\":\"K3MAF00804_P.zip\",\"timeStamp\":\"58944\",\"width\":1280,"
                "\"height\":720},\"cocosData\":{\"id\":\"itemId-a3358be32899e6dd\","
                "\"descName\":\"MAL3W02D3Q4.mp4\",\"type\":\"video\",\"x\":-280,\"y\":105.71,\"anchorX\":0.5,"
                "\"anchorY\":0.5,\"active\":true,\"opacity\":255,\"scale\":1,\"zIndex\":101,"
                "\"isFullScreen\":false,\"isRemoteVideo\":true,\"playerType\":\"IjkPlayer\",\"startTime\":0,"
                "\"width\":1280,\"height\":720,\"resource\":{"
                "\"resource_id\":\"b7fb836785284d568d477321ee2e233e\",\"resource_name\":\"MAL3W02D3Q4.mp4\","
                "\"resource_type\":\"video\",\"resource_version\":\"9\",\"files\":[{"
                "\"file_id\":\"679e60d92fc443bdb86a7de8b1726d80\",\"file_name\":\"MAL3W02D3Q4.mp4\","
                "\"file_path\":\"\",\"file_path_deploy\":\"video/MAL3W02D3Q4.mp4\","
                "\"file_md5\":\"e81bf6ce7498a1cb2593eae6c27fda89\","
                "\"file_cdn_url\":\"https://qiniucdn.jiliguala.com/resource/crmprod"
                "/e81bf6ce7498a1cb2593eae6c27fda89-MAL3W02D3Q4.mp4\","
                "\"file_dc_id\":\"/upload/crmprod/e81bf6ce7498a1cb2593eae6c27fda89-MAL3W02D3Q4.mp4\"}],"
                "\"upload_id\":\"13f8cb3b22524cc4a5ba955aa5d05493\",\"upload_name\":\"K3MAF00804_P.zip\","
                "\"source_type\":\"private\"},\"children\":[]}}],\"logic\":{},\"type\":\"section\",\"webAttrs\":{"
                "\"modelList\":[],\"thumbnail\":\"\",\"config\":{\"descName\":{\"isShow\":true},"
                "\"enterTransition\":{\"isShow\":true},\"leaverTransition\":{\"isShow\":true},\"thumbnail\":{"
                "\"isShow\":true},\"copy\":{\"isShow\":true},\"delete\":{\"isShow\":true}},\"index\":0}},"
                "{\"descName\":\"section-1\",\"id\":\"a3359225666c3f88\",\"background\":\"\","
                "\"enterTransition\":\"default\",\"leaverTransition\":\"default\",\"views\":[{\"config\":{"
                "\"id\":{\"type\":\"string\",\"value\":\"itemId-a3359726e3ba80f0\",\"inputType\":\"input\","
                "\"isShow\":false,\"writed\":false,\"disabled\":false,\"name\":\"id\"},\"type\":{"
                "\"type\":\"string\",\"value\":\"cocosComponent\",\"inputType\":\"input\",\"isShow\":false,"
                "\"writed\":false,\"disabled\":false,\"name\":\"类型\"},\"compType\":{\"parentId\":\"\","
                "\"type\":\"string\",\"value\":\"recordScoreCalculator\",\"inputType\":\"input\","
                "\"isShow\":false,\"writed\":false,\"disabled\":false,\"name\":\"类型\"},\"descName\":{"
                "\"maxlength\":20,\"type\":\"string\",\"value\":\"录音计分组件\",\"inputType\":\"string\","
                "\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"名称\"},\"resource\":{"
                "\"type\":\"object\",\"value\":{\"resource_id\":\"2ed1c8150f584af7aae2de48baf1a043\","
                "\"resource_name\":\"L4U01W1D4Q1_p1.png\",\"resource_type\":\"image\",\"resource_version\":\"5\","
                "\"files\":[{\"file_id\":\"bed5c58c23f7416cb69164a64f54b221\","
                "\"file_name\":\"L4U01W1D4Q1_p1.png\",\"file_path\":\"\","
                "\"file_path_deploy\":\"image/L4U01W1D4Q1_p1.png\","
                "\"file_md5\":\"fa12e21abf7872e4063f7d464f36a172\","
                "\"file_cdn_url\":\"https://qiniucdn.jiliguala.com/resource/crmsandbox"
                "/fa12e21abf7872e4063f7d464f36a172-L4U01W1D4Q1_p1.png\","
                "\"file_dc_id\":\"/upload/crmsandbox/fa12e21abf7872e4063f7d464f36a172-L4U01W1D4Q1_p1.png\"}],"
                "\"upload_id\":\"947c399cdea344089ff51be88c670245\",\"upload_name\":\"L4U01W1D4Q1_P.zip\","
                "\"source_type\":\"private\",\"isSelected\":true},\"inputType\":\"resource\",\"isShow\":true,"
                "\"writed\":true,\"disabled\":true,\"name\":\"替换文件\"},\"size\":{\"type\":\"object\",\"value\":{},"
                "\"inputType\":\"parent\",\"isShow\":true,\"writed\":true,\"disabled\":true,\"name\":\"尺寸\","
                "\"children\":{\"width\":{\"type\":\"number\",\"value\":180,\"inputType\":\"input\","
                "\"isShow\":true,\"writed\":true,\"disabled\":true,\"name\":\"宽\"},\"height\":{"
                "\"type\":\"number\",\"value\":180,\"inputType\":\"input\",\"isShow\":true,\"writed\":true,"
                "\"disabled\":true,\"name\":\"高\"}}},\"position\":{\"type\":\"object\",\"value\":{},"
                "\"inputType\":\"parent\",\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"位置坐标\","
                "\"children\":{\"x\":{\"type\":\"number\",\"value\":0,\"inputType\":\"input\",\"isShow\":true,"
                "\"writed\":true,\"disabled\":false,\"name\":\"X\"},\"y\":{\"type\":\"number\",\"value\":0,"
                "\"inputType\":\"input\",\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"Y\"}}},"
                "\"scale\":{\"type\":\"number\",\"value\":1,\"inputType\":\"number\",\"isShow\":true,"
                "\"writed\":true,\"disabled\":false,\"name\":\"缩放比例\"},\"flip\":{\"type\":\"object\",\"value\":{"
                "},\"inputType\":\"parent\",\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"翻转\","
                "\"children\":{\"flipX\":{\"type\":\"boolean\",\"value\":false,\"inputType\":\"buttonSelect\","
                "\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"水平\",\"icon\":\"iconicon_level\"},"
                "\"flipY\":{\"type\":\"boolean\",\"value\":false,\"inputType\":\"buttonSelect\",\"isShow\":true,"
                "\"writed\":true,\"disabled\":false,\"name\":\"垂直\",\"icon\":\"iconicon_vertical\"}}},"
                "\"zIndex\":{\"type\":\"number\",\"value\":101,\"inputType\":\"number\",\"isShow\":true,"
                "\"writed\":true,\"disabled\":false,\"name\":\"图层\"},\"active\":{\"type\":\"boolean\","
                "\"value\":true,\"inputType\":\"boolean\",\"isShow\":true,\"writed\":true,\"disabled\":false,"
                "\"name\":\"是否可见\"},\"children\":{\"parentId\":\"\",\"type\":\"array\",\"value\":[],"
                "\"inputType\":\"children\",\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"子节点\"},"
                "\"recordCompID\":{\"parentId\":\"\",\"type\":\"component_id\",\"value\":\"\","
                "\"inputType\":\"bind-record\",\"isShow\":true,\"writed\":true,\"disabled\":false,"
                "\"name\":\"绑定录音组件ID\",\"selectOption\":[]},\"knowledgeIdList\":{\"parentId\":\"\","
                "\"type\":\"arr-string\",\"value\":[],\"inputType\":\"arr-string\",\"isShow\":true,"
                "\"writed\":true,\"disabled\":false,\"name\":\"计分器所对应知识点\",\"selectOption\":[]},\"skillIdList\":{"
                "\"parentId\":\"\",\"type\":\"arr-string\",\"value\":[],\"inputType\":\"arr-string\","
                "\"isShow\":true,\"writed\":true,\"disabled\":false,\"name\":\"计分器所对应技能点\",\"selectOption\":[]}},"
                "\"webAttrs\":{\"resourceList\":[],"
                "\"url\":\"https://qiniucdn.jiliguala.com/resource/crmsandbox/fa12e21abf7872e4063f7d464f36a172"
                "-L4U01W1D4Q1_p1.png\",\"webBlock\":{\"webType\":\"component\",\"name\":\"录音计分组件\","
                "\"type\":\"recordScoreCalculator\",\"icon\":{\"width\":180,\"height\":180,\"resource\":{"
                "\"data\":{\"resource_id\":\"2ed1c8150f584af7aae2de48baf1a043\","
                "\"resource_name\":\"L4U01W1D4Q1_p1.png\",\"resource_type\":\"image\",\"resource_version\":\"5\","
                "\"files\":[{\"file_id\":\"bed5c58c23f7416cb69164a64f54b221\","
                "\"file_name\":\"L4U01W1D4Q1_p1.png\",\"file_path\":\"\","
                "\"file_path_deploy\":\"image/L4U01W1D4Q1_p1.png\","
                "\"file_md5\":\"fa12e21abf7872e4063f7d464f36a172\","
                "\"file_cdn_url\":\"https://qiniucdn.jiliguala.com/resource/crmsandbox"
                "/fa12e21abf7872e4063f7d464f36a172-L4U01W1D4Q1_p1.png\","
                "\"file_dc_id\":\"/upload/crmsandbox/fa12e21abf7872e4063f7d464f36a172-L4U01W1D4Q1_p1.png\"}],"
                "\"upload_id\":\"947c399cdea344089ff51be88c670245\",\"upload_name\":\"L4U01W1D4Q1_P.zip\","
                "\"source_type\":\"private\",\"isSelected\":true}}},\"definedKey\":[{\"label\":\"绑定录音组件ID\","
                "\"webType\":\"component_id\",\"defaultValue\":\"\",\"name\":\"recordCompID\","
                "\"type\":\"component_id\"},{\"label\":\"计分器所对应知识点\",\"webType\":\"string\",\"defaultValue\":[],"
                "\"name\":\"knowledgeIdList\",\"type\":\"arr-string\"},{\"label\":\"计分器所对应技能点\","
                "\"webType\":\"string\",\"defaultValue\":[],\"name\":\"skillIdList\",\"type\":\"arr-string\"}],"
                "\"method\":[],\"triggers\":[]}},\"cocosData\":{\"id\":\"itemId-a3359726e3ba80f0\","
                "\"type\":\"cocosComponent\",\"compType\":\"recordScoreCalculator\",\"descName\":\"录音计分组件\","
                "\"resource\":{\"resource_id\":\"2ed1c8150f584af7aae2de48baf1a043\","
                "\"resource_name\":\"L4U01W1D4Q1_p1.png\",\"resource_type\":\"image\",\"resource_version\":\"5\","
                "\"files\":[{\"file_id\":\"bed5c58c23f7416cb69164a64f54b221\","
                "\"file_name\":\"L4U01W1D4Q1_p1.png\",\"file_path\":\"\","
                "\"file_path_deploy\":\"image/L4U01W1D4Q1_p1.png\","
                "\"file_md5\":\"fa12e21abf7872e4063f7d464f36a172\","
                "\"file_cdn_url\":\"https://qiniucdn.jiliguala.com/resource/crmsandbox"
                "/fa12e21abf7872e4063f7d464f36a172-L4U01W1D4Q1_p1.png\","
                "\"file_dc_id\":\"/upload/crmsandbox/fa12e21abf7872e4063f7d464f36a172-L4U01W1D4Q1_p1.png\"}],"
                "\"upload_id\":\"947c399cdea344089ff51be88c670245\",\"upload_name\":\"L4U01W1D4Q1_P.zip\","
                "\"source_type\":\"private\",\"isSelected\":true},\"width\":180,\"height\":180,\"x\":0,\"y\":0,"
                "\"scale\":1,\"flipX\":false,\"flipY\":false,\"zIndex\":101,\"active\":true,\"children\":[],"
                "\"recordCompID\":\"\",\"knowledgeIdList\":[],\"skillIdList\":[]}}],\"logic\":{},"
                "\"type\":\"section\",\"webAttrs\":{\"modelList\":[],\"thumbnail\":\"\",\"config\":{"
                "\"descName\":{\"isShow\":true},\"enterTransition\":{\"isShow\":true},\"leaverTransition\":{"
                "\"isShow\":true},\"thumbnail\":{\"isShow\":true},\"copy\":{\"isShow\":true},\"delete\":{"
                "\"isShow\":true}},\"index\":1}}]",
    "resource_json": "[]",
    "text_json": "{\"descName\":\"simon zhao 测试课程\",\"id\":\"simonzhaotest002\",\"type\":\"game\","
                 "\"package\":\"simonzhaotest002_P\",\"isPlatform\":true,\"views\":[],\"interactive\":{},"
                 "\"actions\":{},\"sections\":{\"a335896adcf14976\":{\"descName\":\"section-0\","
                 "\"id\":\"a335896adcf14976\",\"background\":\"\",\"enterTransition\":\"default\","
                 "\"leaverTransition\":\"default\",\"views\":[{\"id\":\"itemId-a3358be32899e6dd\","
                 "\"descName\":\"MAL3W02D3Q4.mp4\",\"type\":\"video\",\"x\":-280,\"y\":105.71,\"anchorX\":0.5,"
                 "\"anchorY\":0.5,\"active\":true,\"opacity\":255,\"scale\":1,\"zIndex\":101,"
                 "\"isFullScreen\":false,\"isRemoteVideo\":true,\"playerType\":\"IjkPlayer\",\"startTime\":0,"
                 "\"width\":1280,\"height\":720,\"resource\":{\"name\":\"MAL3W02D3Q4.mp4\","
                 "\"id\":\"b7fb836785284d568d477321ee2e233e\"},\"children\":[]}],\"type\":\"section\","
                 "\"interactive\":{},\"actions\":{}},\"a3359225666c3f88\":{\"descName\":\"section-1\","
                 "\"id\":\"a3359225666c3f88\",\"background\":\"\",\"enterTransition\":\"default\","
                 "\"leaverTransition\":\"default\",\"views\":[{\"id\":\"itemId-a3359726e3ba80f0\","
                 "\"type\":\"cocosComponent\",\"compType\":\"recordScoreCalculator\",\"descName\":\"录音计分组件\","
                 "\"resource\":{\"name\":\"L4U01W1D4Q1_p1.png\",\"id\":\"2ed1c8150f584af7aae2de48baf1a043\"},"
                 "\"width\":180,\"height\":180,\"x\":0,\"y\":0,\"scale\":1,\"flipX\":false,\"flipY\":false,"
                 "\"zIndex\":101,\"active\":true,\"children\":[],\"recordCompID\":\"\",\"knowledgeIdList\":[],"
                 "\"skillIdList\":[]}],\"type\":\"section\",\"interactive\":{},\"actions\":{}}},\"subPackages\":["
                 "]}",
    "web_class": "private",
    "edit_status": 1,
    "thumbnail": "https://qiniucdn.jiliguala.com/resource/crmsandbox/1f0948395e8bc1ac35c6fdf4b2c568cd"
                 "-MAL1W09D4Q1_pic_P2_3_heart.png",
    "web_name": "simon zhao 测试课程",
    "remote_videos": "[\"b7fb836785284d568d477321ee2e233e\"]",
    "web_id": "17a6d2e902e54b1ca85be0222d2cdc33"
}


def json_test(editor_info: dict):
    for check_json in ['resource_json', 'text_json', 'remote_videos']:
        try:
            json.loads(editor_info[check_json])
        except TypeError:
            print(F"{check_json}不能反序列化")


def json_dumps():
    x_before = {'name': '张三', 'age': 19, 'city': '四川'}
    print("转换前 ", x_before)
    # 用dumps将python编码成json字符串
    print("转换后 ", json.dumps(x_before))


# json.loads 操作的是字符串，json.load操作的是文件
def json_loads():
    s = '{"name": "wade", "age": 54, "gender": "man"}'
    # json.loads读取字符串并转为Python对象
    print("json.loads将字符串转为Python对象: type(json.loads(s)) = {}".format(type(json.loads(s))))


def json_loads_editor_info():
    for check_json in ['resource_json', 'text_json', 'remote_videos']:
        try:
            print(check_json, json.loads(editor_info[check_json]))
        except TypeError:
            print(F"{check_json}不能反序列化")


if __name__ == '__main__':
    # print(return_value_with_if_else(1))
    # json_loads()

    # json_loads_editor_info()

    # file_obj = io.BytesIO(editor_info["text_json"].encode("utf-8"))
    # file_data = file_obj.read()
    # file_obj.seek(0)
    # print("seek(0)", file_obj.read())
    # # seek()指定从第几个字节开始读
    # file_obj.seek(1)
    # print("seek(1)", file_obj.read())

    h.hhh()
